package com.cskaoyan.controller;

import com.cskaoyan.service.UserService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.UserVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("admin/user/list")//page=1&limit=20&sort=add_time&order=desc
    public BaseRespVo list(Integer page, Integer limit, String sort, String order,String username,String mobile) {
        //page和limit 分页     👉 分页插件
        //sort和order 数据排序  👉 逆向工程生成的方法来做
        UserVo userVo = userService.query(page,limit,sort,order,username,mobile);
        return BaseRespVo.ok(userVo);
    }




}
